function avg(...)
    -- 用这种方式保存到 arg
    local arg={...}
    print("#arg = "..#arg)
    if(#arg > 0) then
        sum = 0
        for i,v in ipairs(arg) do
            sum = sum + v
        end
        return sum/#arg
    end
end

print(avg(1, 2, 3))
--[[
--> #arg = 3 
--> 2.0
--]]

